#ifndef DATAMANAGER_H__
#define DATAMANAGER_H__


struct UploadFileTable 
{
	int nFileId;
	CString strUserId;
	CString strFilePath;
	int nFileSize;
	int nCurNum;
	int nTotalNum;
	int nSliceSize;
	CString strServer;

	int nType;
	int nParentId;

};










class CJsonData;
class CXmlData;
class CConfigData;
class CppSQLite3DB;

class CDataManager
{
public:
	static CDataManager* GetInstance()
	{
		static CDataManager sObj;
		return &sObj;
	}

	~CDataManager();

	void Init();
	const CJsonData	*GetJsonData(){return m_pJsonData;}
	const CXmlData	*GetXmlData(){return m_pXmlData;}

	bool SetCurDB(const CString& strDBPath);
	bool CloseCurDB();

	bool InsertUploadFile(const UploadFileTable& sData);
	bool QueryUploadFile(vector<UploadFileTable> & vData,int nFileId);
	bool UpdateUploadFile(const UploadFileTable& sData);
	bool DeleteUploadFile(int nFileId);

protected:
	CDataManager();
private:

	CJsonData	*m_pJsonData;
	CXmlData	*m_pXmlData;
	CConfigData	*m_pConfigData;

	CppSQLite3DB* m_pSQLite3DB;
};

#endif